home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: "Reed R. Mangino" <mangino@planet.net>
- Newsgroups: comp.lang.c,comp.lang.c.moderated
- Subject: const pointer confusion...
- Date: 23 Mar 1996 00:42:30 -0600
- Organization: Dialogic Corporation
- Sender: clc@solutions.solon.com
- Approved: clc@solutions.solon.com
- Message-ID: <4j06gm$7oa@solutions.solon.com>
- NNTP-Posting-Host: solutions.solon.com
- X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
-
- Could someone please straighten me out on this:
-
- 1) const int *p = 10;
- p is a constant pointer to an int, right? While p can be made to
- point to something else, *p can never be assigned to, right?
-
- 2) int *const p;
- p is a pointer to an integer. *p can be assigned to, but p can
- never be made to point to another address in memory, right?
-
- 3) int const *p;
- What the heck is this? I can't find anything like this in my
- books, but my compiler thinks everything is hunky doory!???
-
- Thank you for your time and consideration!
- Reed
- --
- ____________________________________________________
- \Reed R. Mangino \ ** Dialogic Corporation ** \
- / mangino@planet.net / World leader in the design of/
- \ tornado@esu.edu \ computer telephony systems \
-